/*
 * Copyright (c) 2011 Jean-Marc Perronne
 * Ensisa, 12 rue des Freres Lumieres, F-68093 Mulhouse cedex
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jean-Marc Perronne. For details see accompanying license terms. 
 */

package fr.uha.ensisa.jmp.drone.ui.instrument.dial.model;

import java.util.Map;

import fr.uha.ensisa.jmp.ui.model.DefaultCompoundModel;
import fr.uha.ensisa.jmp.ui.utils.ColoredRanges;


public class DefaultCompoundDialModel extends DefaultCompoundModel implements CompoundDialModel
{

	private DialModel getDialModel(String modelKey)
	{
		return (DialModel) this.models.get(modelKey);
	}
	
	@Override
	public boolean getPaintBackground(String modelKey)
	{
		return this.getDialModel(modelKey).getPaintBackground();
	}

	@Override
	public void setPaintBackground(String modelKey, boolean v)
	{
		this.getDialModel(modelKey).setPaintBackground(v);
	}

	@Override
	public boolean getPaintTicks(String modelKey)
	{
		return this.getDialModel(modelKey).getPaintTicks();
	}

	@Override
	public void setPaintTicks(String modelKey, boolean v)
	{
		this.getDialModel(modelKey).setPaintTicks(v);
	}

	@Override
	public boolean getPaintLabels(String modelKey)
	{
		return this.getDialModel(modelKey).getPaintLabels();
	}

	@Override
	public void setPaintLabels(String modelKey, boolean v)
	{
		this.getDialModel(modelKey).setPaintLabels(v);
	}

	@Override
	public boolean getPaintTrack(String modelKey)
	{
		return this.getDialModel(modelKey).getPaintTrack();
	}

	@Override
	public void setPaintTrack(String modelKey, boolean v)
	{
		this.getDialModel(modelKey).setPaintTrack(v);		
	}

	@Override
	public Map<Integer, String> getLabelsTable(String modelKey)
	{
		return this.getDialModel(modelKey).getLabelsTable();
	}

	@Override
	public void setLabelTable(String modelKey, Map<Integer, String> labels)
	{
		this.getDialModel(modelKey).setLabelTable(labels);
	}

	@Override
	public void setLabelsColors(String modelKey, ColoredRanges labelsColors)
	{
		this.getDialModel(modelKey).setLabelsColors(labelsColors);
	}

	@Override
	public ColoredRanges getLabelsColors(String modelKey)
	{
		return this.getDialModel(modelKey).getLabelsColors();
	}

	@Override
	public void setTrackColors(String modelKey, ColoredRanges trackColors)
	{
		this.getDialModel(modelKey).setTrackColors(trackColors);
	}

	@Override
	public ColoredRanges getTrackColors(String modelKey)
	{
		return this.getDialModel(modelKey).getTrackColors();
	}

	@Override
	public void setTicksColors(String modelKey, ColoredRanges ticksColors)
	{
		this.getDialModel(modelKey).setTicksColors(ticksColors);		
	}

	@Override
	public ColoredRanges getTicksColors(String modelKey)
	{
		return this.getDialModel(modelKey).getTicksColors();
	}

	@Override
	public int getMajorTickSpacing(String modelKey)
	{
		return this.getDialModel(modelKey).getMajorTickSpacing();
	}

	@Override
	public void setMajorTickSpacing(String modelKey, int v)
	{
		this.getDialModel(modelKey).setMajorTickSpacing(v);		
	}

	@Override
	public int getMinorTickSpacing(String modelKey)
	{
		return this.getDialModel(modelKey).getMinorTickSpacing();
	}

	@Override
	public void setMinorTickSpacing(String modelKey, int v)
	{
		this.getDialModel(modelKey).setMinorTickSpacing(v);	
	}
}
